package com.aldobucchi.ds.container.zet.impl
{
	import com.aldobucchi.ds.container.zet.IRWSet;
	import com.aldobucchi.utils.AbstractTest;

	public class RWSingleValueSetTest extends AbstractTest
	{



		
		public function testMisc( ):void
		{
		
			var zet:IRWSet = new RWSingleValueSet( );
			
				assertEquals( zet.size , 0 );
				assertTrue( zet.isEmpty  );
				assertFalse( zet.contains( "a" ) );
			
			
			zet.add( "a" );			
			
				assertEquals( zet.size , 1 );
				assertFalse( zet.isEmpty  );
				assertTrue( zet.contains( "a" ) );
				assertEquals( zet.getMultiplicity( "a" ), 1 );		
			
			
				zet.walk( function(e:*, m:int ):void {
				
					assertEquals( e, "a" );
					assertEquals( m, 1 );					
				
				} );
			
			
			zet.remove( "a" );
			
				assertEquals( zet.size , 0 );
				assertTrue( zet.isEmpty  );
				assertFalse( zet.contains( "a" ) );
				assertEquals( zet.getMultiplicity( "a" ), 0 );		
			

			// repeat tests with another element

			zet.add( "b" );
			
		
				assertEquals( zet.size , 1 );
				assertFalse( zet.isEmpty  );
				assertTrue( zet.contains( "b" ) );
				assertEquals( zet.getMultiplicity( "b" ), 1 );		
			
			
				zet.walk( function(e:*, m:int ):void {
				
					assertEquals( e, "b" );
					assertEquals( m, 1 );					
				
				} );
		
		
			// but now we call clear()

			zet.clear(  );
			
				assertEquals( zet.size , 0 );
				assertTrue( zet.isEmpty  );
				assertFalse( zet.contains( "b" ) );
				assertEquals( zet.getMultiplicity( "b" ), 0 );			
		
		
		
		
		
		
		
		}



		
	}
}